<!-- 获取社团的荣誉列表，暂时没有做懒加载，page暂时定为1，pageNum暂时为10 -->
<template>
	<view>
		<view class="out-border-line">
			<view class="flex-column common-width90">
				<text class="title-text">荣誉奖项</text>
				<view class="flex-just " v-for="(item,index) in honourList" :key="index">
					<text class="time-text">{{item.year}}年</text>
					<view class="right-box2 flex-just" v-if="index == (honourList.length-1)">
						<text class="right-box-left fontside-14">{{item.name}}</text>
						<text class="right-box-right fontside-14">{{item.award}}</text>
					</view>
					<view class="right-box flex-just" v-else>
						<text class="right-box-left fontside-14">{{item.name}}</text>
						<text class="right-box-right fontside-14">{{item.award}}</text>
					</view>
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	import {
		getHonourList
	} from '@/common/api/corporation/corporationActivity.js'
	import {getTimeYear} from '@/common/utils/timeParseInt.js'
	export default {
		data() {
			return {
				honourList: []
			}
		},
		methods: {
			// 获取荣誉奖项列表
			getHonourList:function(){
				var that = this
				getHonourList(uni.getStorageSync("clubId"),{
					pageNum: 1,
					pageSize: 10
				}).then(res => {
					if(res.data.code == 200){
						if(res.data.data.list.length != 0) {
							if(res.data.data.list != null) {
								res.data.data.list.forEach(function(item,index){
									that.honourList.push({
										year: getTimeYear(item.year),
										name: item.name,
										award: item.award
									})
								})
							}
						} else {
							uni.showToast({
								title: "暂时没有数据",
								icon: 'none'
							})
						}
						
					} else {
						uni.showToast({
							title: "网络错误",
							icon: "none"
						})
					}
				})
			},
		},
		onLoad() {
			this.getHonourList()
		}
	}
</script>

<style>
.title-text{
	width: 100%;
	height: 70rpx;
	line-height: 70rpx;
	font-size: 20px;
	font-weight: bold;
}
.time-text{
	width:20%;
	height: 80rpx;
	line-height: 80rpx;
}
.right-box{
	width: 80%;
	height: 80rpx;
	line-height: 80rpx;
	border-bottom: 1px solid #E2E2E2;
}
.right-box2{
	width: 80%;
	height: 80rpx;
	line-height: 80rpx;
}
.right-box-left{
	width:65%;
	height: 100%;
}
.right-box-right{
	width:35%;
	height: 100%;
}
</style>
